#include "NetPlugin.h"
#include "NetModule.h"
#include "NetClientModule.h"
//#include "NFHttpClientModule.h"
//#include "NFHttpServerModule.h"
//#include "NFWSModule.h"
#include "PluginModule/IPluginManager.h"

using namespace FragrantGrass;

#ifdef FG_DYNAMIC_PLUGIN

FG_EXPORT void DllStartPlugin(IPluginManager* pm)
{
    CREATE_PLUGIN(pm, NetPlugin)

};

FG_EXPORT void DllStopPlugin(IPluginManager* pm)
{
    DESTROY_PLUGIN(pm, NetPlugin)
};

#endif


//////////////////////////////////////////////////////////////////////////

const int NetPlugin::GetPluginVersion()
{
    return 0;
}

const std::string NetPlugin::GetPluginName()
{
	return GET_CLASS_NAME(NetPlugin);
}

void NetPlugin::Install()
{
    REGISTER_MODULE(m_pPluginManager, INetModule, NetModule)
	//REGISTER_MODULE(m_pPluginManager, NFIWSModule, NFWSModule)
	//REGISTER_MODULE(m_pPluginManager, NFIHttpServerModule, NFHttpServerModule)
	REGISTER_MODULE(m_pPluginManager, INetClientModule, NetClientModule)
	//REGISTER_MODULE(m_pPluginManager, NFIHttpClientModule, NFHttpClientModule)
}

void NetPlugin::Uninstall()
{
	//UNREGISTER_MODULE(m_pPluginManager, NFIHttpClientModule, NFHttpClientModule)
	UNREGISTER_MODULE(m_pPluginManager, INetClientModule, NetClientModule)
	//UNREGISTER_MODULE(m_pPluginManager, NFIHttpServerModule, NFHttpServerModule)
	//UNREGISTER_MODULE(m_pPluginManager, NFIWSModule, NFWSModule)
    UNREGISTER_MODULE(m_pPluginManager, INetModule, NetModule)
}